Skip to content

fix(seo): canonicalize chain URLs on bench routes (kill uppercase orphans)#755

Merged
Flotapponnier merged 1 commit into
mainfrom
fix/canonical-chain-urls
Jun 26, 2026
Merged

fix(seo): canonicalize chain URLs on bench routes (kill uppercase orphans)#755
Flotapponnier merged 1 commit into
mainfrom
fix/canonical-chain-urls

Conversation

@Flotapponnier

Copy link
Copy Markdown
Collaborator

Problem

Ahrefs flagged 3 soft-orphan URLs on `/benchmarks/perp-fees`:

  • `/benchmarks/perp-fees/eth`
  • `/benchmarks/perp-fees/btc`
  • `/benchmarks/perp-fees/sol`

All return 200, all listed in sitemap, but zero inlinks. Cause:

  • `perp-fees.yml` defines `dimensions.chain` values as `ETH`, `BTC`, `SOL` (uppercase asset codes for Prom label injection)
  • Parent page `PerChainPagesNav` rendered `href=/benchmarks/perp-fees/ETH` straight from `c.value`
  • Sitemap emits lowercase via `canonicalChainSlug`
  • `matchesChainSlug` is case-insensitive so both `/ETH` and `/eth` returned 200 → duplicate content + lowercase orphans

Fix

  • `PerChainPagesNav` (parent → chain) + `SiblingChains` (chain → sibling) hrefs now use `canonicalChainSlug(c.value)` so internal links match the sitemap canonical
  • `[chain]/page.tsx` 308s non-canonical casings + legacy aliases (e.g. `/ETH → /eth`, `/ton → /gram`) to the canonical lowercase slug, also consolidating external links

YAML values stay uppercase (Prom label injection unchanged).

Test plan after `vercel --prod`

  • `curl -I /benchmarks/perp-fees/ETH` → 308 to `/eth`
  • `curl -I /benchmarks/perp-fees/eth` → 200
  • View source of `/benchmarks/perp-fees` → hrefs are lowercase
  • `curl -I /benchmarks/l1-finality/ton` → still 308 to `/gram` (existing alias still works)

…hans)

Parent /benchmarks/<slug> page rendered links to /benchmarks/<slug>/ETH
straight from the YAML dimension value, while the sitemap emitted the
lowercase canonical /eth. matchesChainSlug() is case-insensitive so
both URLs returned 200 — Ahrefs flagged the lowercase variants as
orphans (zero inlinks) and Google sees duplicate content.

Two fixes:
- PerChainPagesNav + SiblingChains now use canonicalChainSlug(c.value)
  so internal hrefs match the sitemap canonical
- [chain]/page.tsx 308s any non-canonical casing or legacy alias to
  the canonical lowercase slug, consolidating external links too
@Flotapponnier
Flotapponnier merged commit 8837340 into main Jun 26, 2026
1 check passed
@Flotapponnier
Flotapponnier deleted the fix/canonical-chain-urls branch July 17, 2026 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant